//
//  Dictionary+Ext.swift
//  KLExtension
//
//  Created by nkl on 2023/6/29.
//

import Foundation

extension Dictionary {
    public func asJsonString() -> String {
        if let data = try? JSONSerialization.data(withJSONObject: self, options: JSONSerialization.WritingOptions(rawValue: 0)) {
            if let jsonStr = String(data: data, encoding: .utf8) {
                return jsonStr
            }
            return ""
        }
        return ""
    }
}
